import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/components/Login'
import main from '@/views/main'
import dept from '@/views/dept'
import role from '@/views/role'
import user from '@/views/user'
import roleaccess from '@/views/roleaccess'
import dftu from '@/views/dftu'
import sftu from '@/views/sftu'
import xdf from '@/views/xdf'
import fangwu from '../views/zyh/fangwu'
import ld from '../views/zyh/ld'
import shop from '../views/zyh/Shop'
import xzl from '../views/zyh/xzl'
import yezhu from '../views/zyh/yezhu'
import zuhu from '../views/zyh/zuhu'
import df from '@/views/qy/df'
import sf from '@/views/qy/sf'
import wyf from '@/views/qy/wyf'

Vue.use(VueRouter)
const routes = [
  {
    path: '/',
    name: '/',
    component: Login
  },
  {
    path: '/Login',
    name: 'Login',
    component: Login
  },
  {
    path: '/main',
    name: 'Main',
    component: main,
    children: [
      {
        path: '/dept',
        name: 'dept',
        component: dept
      },
      {
        path: '/role',
        name: 'role',
        component: role
      },
      {
        path: '/user',
        name: 'user',
        component: user
      },
      {
        path: '/roleaccess',
        name: 'roleaccess',
        component: roleaccess
      },
      {
        path: '/dftu',
        name: 'dftu',
        component: dftu
      },
      {
        path: '/sftu',
        name: 'sftu',
        component: sftu
      },
      {
        path: '/xdf',
        name: 'xdf',
        component: xdf
      },
      {
        path: '/fangwu',
        name: 'fangwu',
        component: fangwu
      },
      {
        path: '/ld',
        name: 'ld',
        component: ld
      },
      {
        path: '/shop',
        name: 'shop',
        component: shop
      },
      {
        path: '/xzl',
        name: 'xzl',
        component: xzl
      },
      {
        path: '/yezhu',
        name: 'yezhu',
        component: yezhu
      },
      {
        path: '/zuhu',
        name: 'zuhu',
        component: zuhu
      },
      {
        path: '/wyf',
        name: 'wyf',
        component: wyf
      },
      {
        path: '/df',
        name: 'df',
        component: df
      },
      {
        path: '/sf',
        name: 'sf',
        component: sf
      }
    ],
    meta: {
      requireAuth: true // 判断是否需要登录
    }
  }
]

const router = new VueRouter({
  routes
})

export default router
